﻿//*************************************************************************
//面向服务的协作式智能交通系统仿真软件SoC-ITSS v2.1 alpha
//发布单位：西北工业大学--巴黎高科MINES机器人与群智能系统联合实验室
//团队负责人：张凯龙 Zhang Kailong
//团队成员：张大方、杨安胜、王敏、谢策、王雨佳、谢尘玉等
//联系我们：kl.zhang@nwpu.edu.cn
//2012-2021
//*************************************************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CyberCarSimulation.Bean;

//*******************************************************
//
//文件名(File Name):           AboutSoftware.cs
//
//数据表(Tables):              nothing 
//
//          修改理由：         增加界面控件
//
//*******************************************************

namespace CyberCarSimulation.Interface
{
    public partial class AboutSoftware : Form
    {
        private int FormLength = 760;

        private Panel SoftwarePanel;
        private PictureBox SoftwareLogoPictureBox;
        private PictureBox NpuPicatureBox;

        private Panel VersionPanel;
        private Label VersionNameLabel;
        private Label VersionNumLabel;
        private Label VersionCopyrightLabel;
        private Label VersionRightLabel;
        private Label VersionContactLabel;

        private Panel WarningPanel;
        private Label VersionWarningLabel;


        public AboutSoftware()
        {
            InitializeComponent();
            ConfigAboutForm();
        }

        private void ConfigAboutForm() 
        {
            ConfigAboutImage();
            ConfigAboutVersion();
            ConfigAboutWarning();
        }
        private void ConfigAboutImage() 
        {
            SoftwarePanel = new Panel();
            SoftwarePanel.Width = FormLength;
            SoftwarePanel.Height = 80;
            SoftwarePanel.BackColor = System.Drawing.Color.White;
            SoftwarePanel.Location = new System.Drawing.Point(0, 0);
            this.Controls.Add(SoftwarePanel);

            SoftwareLogoPictureBox = new PictureBox();
            SoftwareLogoPictureBox.Size = new Size(150, 64);
            SoftwareLogoPictureBox.Location = new System.Drawing.Point(130, 8);
            string MapUrl = MainData.Map.GetMapImageURL();
            string LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\Softlogo.png";
            SoftwareLogoPictureBox.Image = Image.FromFile(LogoUrl);
            SoftwareLogoPictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            SoftwarePanel.Controls.Add(SoftwareLogoPictureBox);

            NpuPicatureBox = new PictureBox();
            NpuPicatureBox.Size = new Size(60, 60);
            NpuPicatureBox.Location = new System.Drawing.Point(500, 10);
            MapUrl = MainData.Map.GetMapImageURL();
            LogoUrl = MapUrl.Substring(0, MapUrl.Length - 22);
            LogoUrl += "Images\\NwpuLogo.gif";
            NpuPicatureBox.Image = Image.FromFile(LogoUrl);
            NpuPicatureBox.SizeMode = PictureBoxSizeMode.StretchImage;
            SoftwarePanel.Controls.Add(NpuPicatureBox);
        }

        private void ConfigAboutVersion() 
        {         
            VersionPanel = new Panel();
            VersionPanel.Width = FormLength;
            VersionPanel.Height = 150;
            VersionPanel.Location = new System.Drawing.Point(0, 80);
            this.Controls.Add(VersionPanel);

            VersionNameLabel = new Label();
            VersionNameLabel.Font = new Font("微软雅黑", 11f, FontStyle.Bold);
            VersionNameLabel.Size = new Size(FormLength, 20);
            VersionNameLabel.Location = new System.Drawing.Point(10, 10);
            VersionNameLabel.BackColor = Color.Transparent;
            VersionNameLabel.Text = "SoC-ITS Simulator";
            VersionPanel.Controls.Add(VersionNameLabel);

            VersionNumLabel = new Label();
            VersionNumLabel.Font = new Font("微软雅黑", 11f, FontStyle.Regular);
            VersionNumLabel.Size = new Size(FormLength, 20);
            VersionNumLabel.Location = new System.Drawing.Point(10, 35);
            VersionNumLabel.BackColor = Color.Transparent;
            VersionNumLabel.Text = "Version 2.0";
            VersionPanel.Controls.Add(VersionNumLabel);

            VersionCopyrightLabel = new Label();
            VersionCopyrightLabel.Font = new Font("微软雅黑", 11f, FontStyle.Regular);
            VersionCopyrightLabel.Size = new Size(FormLength, 20);
            VersionCopyrightLabel.Location = new System.Drawing.Point(10, 60);
            VersionCopyrightLabel.BackColor = Color.Transparent;
            VersionCopyrightLabel.Text = "Copyright ©2018 NPU-MINES Paris Tech Joint Laboratory for Robot and Swarm Intelligent Systems.";
            VersionPanel.Controls.Add(VersionCopyrightLabel);

            VersionRightLabel = new Label();
            VersionRightLabel.Font = new Font("微软雅黑", 11f, FontStyle.Regular);
            VersionRightLabel.Size = new Size(FormLength, 20);
            VersionRightLabel.Location = new System.Drawing.Point(10, 85);
            VersionRightLabel.BackColor = Color.Transparent;
            VersionRightLabel.Text = "All rights reserved.";
            VersionPanel.Controls.Add(VersionRightLabel);

            VersionContactLabel = new Label();
            VersionContactLabel.Font = new Font("微软雅黑", 11f, FontStyle.Regular);
            VersionContactLabel.Size = new Size(FormLength, 40);
            VersionContactLabel.Location = new System.Drawing.Point(10, 110);
            VersionContactLabel.BackColor = Color.Transparent;
            VersionContactLabel.Text = "Program related information consultation:kl.zhang@nwpu.edu.cn";
            VersionPanel.Controls.Add(VersionContactLabel);
        }

        private void ConfigAboutWarning() 
        {
            WarningPanel = new Panel();
            WarningPanel.Width = FormLength;
            WarningPanel.Height = 160;
            WarningPanel.Location = new System.Drawing.Point(0, 220);
            this.Controls.Add(WarningPanel);

            VersionWarningLabel = new Label();
            VersionWarningLabel.Font = new Font("微软雅黑", 11f, FontStyle.Regular);
            VersionWarningLabel.Size = new Size(FormLength-20, 150);
            VersionWarningLabel.Location = new System.Drawing.Point(10, 10);
            VersionWarningLabel.BackColor = Color.Transparent;
            VersionWarningLabel.Text = "Warning: This computer program enjoys the protection of copyright law and international treaties. Unauthorized copying or dissemination of this program (or any part thereof) will be subject to severe civil and criminal sanctions and prosecution to the maximum extent permitted by law.";
            WarningPanel.Controls.Add(VersionWarningLabel);
        }
    }
}
